<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ui_processform.aspx.cs" Inherits="Private_Config_Workflow_ui_processform" %>
<%@ Register TagPrefix="Flux" Namespace="Deepcode.Flux.Core.UI.Controls" Assembly="Deepcode.Flux.Core" %>
<html>
<head runat="server">
	<link href="../../../Asset/Style/GeneralStyle.css" rel="stylesheet" type="text/css" />
	<link href="./localstyle.css" rel="stylesheet" type="text/css" />
	<script language="javascript">
	function ConfirmDeleteAction()
	{
		return confirm("Are you sure you wish to delete this startup action");
	}
	function ConfirmDeleteTasking()
	{
		return confirm("Are you sure you wish to delete this tasking");
	}
	</script>
</head>
<body class="nopad">
<form id="form1" runat="server">
<Flux:HostTable runat="server">

<Flux:Section runat="server">
<Flux:ShadePadBox runat="server" CssClass="infoarea">
	<asp:Label runat="server" ID="labHandler" CssClass="info" /><br/>
	<asp:Label runat="server" ID="labDefinition" CssClass="info" /><br/>
	<asp:Label runat="server" ID="labProcess" CssClass="info" />
</Flux:ShadePadBox>
</Flux:Section>

<Flux:ValidationSummarySection runat="server" HeaderText="Please correct the following errors"/>

<Flux:CollapseSection runat="server" Title="Edit Workflow Process">
<Flux:ShadePadBox runat="server">
	<table cellspacing="0" cellpadding="5" border="0" width="500">
	<tr><td nowrap="nowrap">
			Process Name:<%=Required%>
		</td>
		<td><asp:TextBox Runat="server" ID="ProcessName" Width="200px" style="width:200px"/></td>
	</tr>
	<tr><td>
		Rank / Importance:<%=Required%><br/>
		<span class="help">The process with the lowest rank will be executed first</span>
		</td>
		<td><asp:TextBox runat="server" ID="Rank" Width="50px" style="width:50px"/></td>
	</tr>
	<tr><td>Process Type:</td>
		<td><asp:DropDownList runat="server" ID="ProcessType">
			<asp:ListItem Value="0">WAIT (Waits for earlier process tasks)</asp:ListItem>
			<asp:ListItem Value="1">CLEAR (Clears earlier process tasks)</asp:ListItem>
			</asp:DropDownList>
		</td>
	</tr>
	<tr><td>Data can be viewed:</td>
		<td><asp:CheckBox runat="server" ID="DataCanView"/></td>
	</tr>
	<tr><td>Data can be edited:</td>
		<td><asp:CheckBox runat="server" ID="DataCanEdit"/></td>
	</tr>
	</table>
</Flux:ShadePadBox>
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnSave" Text="Save" OnClick="btnSave_Click"/>&nbsp;&nbsp;&nbsp;
</Flux:PadBox>
</Flux:CollapseSection>

<Flux:CollapseSection runat="server" Title="Startup Actions">
<Flux:StandardDataGrid runat="server" ID="startupgrid" DataKeyField="PK_ID" ClickRowSelect="False" AllowPaging="false">
	<Columns>
		<asp:BoundColumn DataField="Rank" ReadOnly="True" HeaderText="Rank"></asp:BoundColumn>
		<asp:BoundColumn DataField="Method" ReadOnly="True" HeaderText="Method"></asp:BoundColumn>
		<asp:TemplateColumn HeaderText="Options">
		<ItemTemplate>
			<asp:LinkButton ID="btnSUDelete" Runat="server" CssClass="DangerLink" CommandName="ItemDelete" CausesValidation="false">[Delete]</asp:LinkButton>
			<asp:LinkButton ID="btnSUUp" Runat="server" CssClass="SafeLink" CommandName="ItemUp" CausesValidation="false">[Up]</asp:LinkButton>
			<asp:LinkButton ID="btnSUDown" Runat="server" CssClass="SafeLink" CommandName="ItemDown" CausesValidation="false">[Down]</asp:LinkButton>
			<asp:LinkButton ID="btnSUProperties" Runat="server" CssClass="SafeLink" CommandName="ItemProperties" CausesValidation="false">[Properties]</asp:LinkButton>
		</ItemTemplate>
		</asp:TemplateColumn>
	</Columns>
</Flux:StandardDataGrid>
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:DropDownList runat="server" ID="ddlActions"/> 
	<asp:Button runat="server" ID="btnAddAction" Text="Add Action" OnClick="btnAddAction_Click" CausesValidation="false"/>&nbsp;&nbsp;&nbsp;
</Flux:PadBox>
</Flux:CollapseSection>

<Flux:CollapseSection runat="server" Title="Taskings">
<Flux:StandardDataGrid runat="server" ID="taskingsgrid" DataKeyField="PK_ID" ClickRowSelect="False" AllowPaging="false">
	<Columns>
		<asp:BoundColumn DataField="TaskCaption" ReadOnly="True" HeaderText="Task"></asp:BoundColumn>
		<asp:BoundColumn DataField="CalcFor" ReadOnly="True" HeaderText="For"></asp:BoundColumn>
		<asp:BoundColumn DataField="CalcStart" ReadOnly="True" HeaderText="Activate"></asp:BoundColumn>
		<asp:BoundColumn DataField="CalcDeadline" ReadOnly="True" HeaderText="Deadline"></asp:BoundColumn>

		<asp:TemplateColumn HeaderText="Options">
		<ItemTemplate>
			<asp:LinkButton ID="btnTDelete" Runat="server" CssClass="DangerLink" CommandName="ItemDelete" CausesValidation="false">[Delete]</asp:LinkButton>
			<asp:LinkButton ID="btnTEdit" Runat="server" CssClass="SafeLink" CommandName="ItemEdit" CausesValidation="false">[Edit]</asp:LinkButton>
		</ItemTemplate>
		</asp:TemplateColumn>
	</Columns>
</Flux:StandardDataGrid>
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnAddUserTasking" Text="Add User Tasking" OnClick="btnAddUserTasking_Click" CausesValidation="false"/>&nbsp;&nbsp;
	<asp:Button runat="server" ID="btnAddSystemTasking" Text="Add System Tasking" OnClick="btnAddSystemTasking_Click" CausesValidation="false"/>
</Flux:PadBox>
</Flux:CollapseSection>

<!-- Validators -->
<asp:RequiredFieldValidator Runat="server" ControlToValidate="ProcessName" ErrorMessage="You must specify the name of this process" Display="None"/>
<asp:RequiredFieldValidator runat="server" ControlToValidate="Rank" ErrorMessage="You must specify a rank for this process" Display="None"/>
<asp:RangeValidator runat="server" ControlToValidate="Rank" ErrorMessage="You must specify a valid whole number for the rank" Display="None" MinimumValue="-1000000" MaximumValue="1000000000" Type="Integer" />

<Flux:Section runat="server">
<Flux:PadBox CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnBack" Text="Back to Process List" OnClick="btnBack_Click" CausesValidation="False"/>
</Flux:PadBox>
</Flux:Section>

</Flux:HostTable>
</form>
</body>
</html>
